
<div *ngIf="!data" class="t-list-title">
  <h2>
      <a  href="#" class="btnBack">创建公告</a>
  </h2>
</div>

<div class="content">
  <div class="content_operation">

      <div class="row_item mt10">
          <span class="title">&nbsp;&nbsp;&nbsp;&nbsp;
              <span class="prompt">*</span>
              主题:</span>
          <span class="input-block" style="width: calc(100% - 132px);">
            <input maxlength="200" [(ngModel)]="title"  placeholder="请输入主题"/>
          </span>
        </div>

        <div class="row_item">
            <span class="title">&nbsp;&nbsp;&nbsp;&nbsp;
                <span class="prompt">*</span>
                内容:</span>
            <span class="input-block" style="width: calc(100% - 132px);">
              <textarea name="" id="" cols="30" rows="5"  maxlength="2000" style="resize:none" [(ngModel)]="content" >

              </textarea>
            </span>
          </div>

          <div class="row_item" style="position: relative;">
              <span class="title">
                <span class="prompt"></span>
                上传模板:</span>
            <div style="display: flex; flex-direction: column;justify-content: center; position: relative;">
                <a style="text-decoration: none; display: inline" href="javascript:;" >
                  <label>
                   <img class="annex_image" style="vertical-align: middle;" src=''/>
                   <span class="annex_text">添加附件</span>
                   <dc-file-upload style="display: none"
                                [acceptType]="['.txt','.doc','.docx','.xls','.xlsx','.ppt','.pptx','.pdf','.jpg','.png','.gif','.rar','.zip', '.bmp']"
                                [options]="options"
                                (fileChangeEvent)="fileChangeEvent($event)"
                                [acceptType]="acceptType"
                                (success)="fileUploadSuccess($event)"
                                [multiple]="true"
                                (error)="fileUploadError($event)"
                                [fileMaxSize]="52428800">
      
                   </dc-file-upload>
                   </label>
                  </a>
                  <b class="upload_text" *ngFor="let file of annex">
                    <a href="{{file.attachUrl}}" target="_blank">{{file.attachName}}</a>
                    <span class="del-icon" (click)="delFiles(file.id, annex)">X</span>
                  </b>
                  <span class="upload_text" class="upload_prompt">
                  上传格式包含：.txt|.doc|.docx|.xls|.xlsx|.ppt|.pptx|.pdf|.jpg|.png|.bmp|.gif|.rar|.zip ，
                  文件只能大于0K且不能超过50M。
                  </span>
            </div>
          </div>

          <div class="row_item">
              <span class="title">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                  <span class="prompt">*</span>
                  类型:</span>
              <span class="input-block" style="width: calc(100% - 132px);font-size: 14px;">             
                     <label for="ver1" style="display: inline-block;">
                         <input [checked]="type==0"
                         id="ver1"
                         style="width: initial;"
                          name="ver"
                         (click)="gettype($event)"
                          required
                          [value]="'公告通知'"
                           type="radio">
                       <span style="position: relative;
                       top: -10px;">公告通知</span>
                     </label>                    
                      <label for="ver2" style="margin-left: 40px;display: inline-block;">
                         <input  [checked]="type==1"
                         id="ver2"
                         style="width: initial;"
                          name="ver"
                          (click)="gettype($event)"
                          required
                          [value]="'信息交流'"
                           type="radio">
                        <span style="position: relative;
                        top: -10px;">信息交流</span>
                        </label>
              </span>
            </div>
            
            <div class="row_item">
                <span class="title">
                    <span class="prompt">*</span>
                    短信通知:</span>
                <span class="input-block" style="width: calc(100% - 132px);font-size: 14px;">             
                       <label for="mes1" style="display: inline-block;">
                           <input [checked]="message==0"
                           id="mes1"
                           style="width: initial;"
                            name="mes"
                           (click)="getmess($event)"
                            required
                            [value]="'是'"
                             type="radio">
                         <span style="position: relative;
                         top: -10px;">是</span>
                       </label>                    
                        <label for="mes2" style="margin-left: 80px;display: inline-block;">
                           <input [checked]="message==1"
                           id="mes2"
                           style="width: initial;"
                            name="mes"
                            (click)="getmess($event)"
                            required
                            [value]="'否'"
                             type="radio">
                          <span style="position: relative;
                          top: -10px;">否</span>
                          </label>
                </span>
              </div>

              <div class="row_item">
                <div class="fl">
                  <span class="title">
                      <span class="prompt">*</span>
                      开启时间:
                    </span>                     
                          <dc-date-picker [date]="startDate" [options]="startDataOptions" (dateChangeEvent)="startDateEvent($event)"></dc-date-picker>
                </div>
                <div class="fr">
                  <span class="title">
                      <span class="prompt">*</span>
                      关闭时间:
                    </span>
                          <dc-date-picker [date]="endDate" [options]="endDataOptions" (dateChangeEvent)="endDateEvent($event)"></dc-date-picker>
                </div>   
                </div>

                <div class="row_item">
                    <span class="title">&nbsp;&nbsp;
                        <span class="prompt">*</span>
                        接收人:</span>
                        <dc-button [text]="'添加接收人'" (click)='addSendeeData()'></dc-button>
                  </div>

                  <div class="row_item" style="padding-left: 100px">

                      <dc-table-new #tableNew [datas]="tableData" [headers]="headerConfig" [options]="tableOption">
                          <ng-template let-data>
                            <dc-table-column-new [header]="data.h" [data]="data.d" [field]="'userName'">
                              {{data.d.userName}}
                            </dc-table-column-new>
                            <dc-table-column-new [header]="data.h" [data]="data.d" [field]="'phone'">
                              {{data.d.phone}}
                            </dc-table-column-new>
                            <dc-table-column-new [header]="data.h" [data]="data.d" [field]="'organName'">
                              {{data.d.organName}}
                            </dc-table-column-new>
                
                            <dc-table-column-new [header]="data.h" [field]="'operation'">
                                <div title="删除" class="table-column-operation" (click)="deleteDemand(data.d)">
                                    <img style="cursor: pointer" src=""/>
                                  </div>
                            </dc-table-column-new>
                          </ng-template>
                      </dc-table-new>
                      <div *ngIf="tableDataAll.length" style="float: left;font-size: 12px;margin-top: 5px;">每页
                     <dc-select [currentSelect]="limit"  [optionList]="limitData" [isReadonly]="true"
                    [displayField]="'field'" [width]="'50px'"
                    (changeValueEvent)="limitSelect($event)"></dc-select>条
                      </div>
                      <div *ngIf="pager3" class="mt10">
                          <dc-pagination #dcpagination [total]="pager3.total" [pageSize]="pager3.limit" [nowPage]="pager3.page" [pageNum]="pager3.pageNum"
                                         (nowPageChange)="nowPageChange($event)"></dc-pagination>
                        </div>
                  </div>
                  <div class="row_item mb50 mt10">
                    <div style="margin: 0 auto;width:350px">
                    <dc-button [text]="'发布公告'" (click)='sendNotice()'></dc-button>
                    <dc-button class="ml20" [text]="'保存'" (click)='save()'></dc-button>
                    <dc-button class="ml20" [text]="'取消'" [type]="2" (click)='cancel()'></dc-button>
                    </div>
                  </div>
              
  </div>
</div>